package com.zyr.exception;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author 张雨润
 * @date 2024/7/25 下午8:27
 * @Description
 */
@Slf4j
@RestControllerAdvice
public class GlobalException {
    @ExceptionHandler(Exception.class)
    public void exceptionHandler(Exception e) {
        log.error("exception:{}", e.getMessage());
    }
    @ExceptionHandler(CustomizeException.class)
    public void customizeExceptionHandler(CustomizeException e) {
        log.error("customizeException:{}", e.getMessage());
    }
}
